package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;

class zajz {
   private zoz a = null;
   private Worksheet b = null;
   private zpa c;
   private static final com.aspose.cells.b.c.a.za d = new com.aspose.cells.b.c.a.za(new String[]{"{7E03D99C-DC04-49d9-9315-930204A7B6E9}", "sparklineGroups", "conditionalFormattings", "dataValidations", "slicerList"});

   zajz(zoz var1, zpa var2) {
      this.a = var1;
      this.c = var2;
      this.b = var2.d;
   }

   void a(zcfw var1, zajy var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(zass.a(var1)) {
            if ("ext".equals(var1.p())) {
               this.b(var1, var2);
            } else {
               var1.a();
            }
         }

      }
   }

   private void a(zcfw var1, String var2, zajy var3) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         for(; zass.a(var1); var1.a()) {
            if ("slicer".equals(var1.p())) {
               zqe var4 = (zqe)this.c.e.get(var1.a("id"));
               var4.a = var2;
               if (this.c.l == null) {
                  this.c.l = new ArrayList();
               }

               com.aspose.cells.b.a.a.ze.a(this.c.l, (Object)var4);
            }
         }

      }
   }

   private void a(zcfw var1, zajy var2, boolean var3) throws Exception {
      var1.d();

      while(var1.r() != 4) {
         var1.j();
         if (var1.r() != 1) {
            var1.a();
         } else if ("conditionalFormatting".equals(var1.p())) {
            var2.b(var1, var3);
         } else {
            var1.a();
         }
      }

      var1.h();
   }

   void b(zcfw var1, zajy var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         String var3 = var1.a("uri");
         switch(d.a(var3)) {
         case 0:
            if (this.b.g.f == null) {
               this.b.g.f = new HashMap();
            }

            this.b.g.f.put(var3, var1.u());
            return;
         default:
            var1.d();

            while(zass.a(var1)) {
               switch(d.a(var1.p())) {
               case 1:
                  this.a(var1);
                  break;
               case 2:
                  this.a(var1, var2, true);
                  break;
               case 3:
                  var2.a(var1, true);
                  break;
               case 4:
                  this.a(var1, var3, var2);
                  break;
               default:
                  var1.a();
               }
            }

         }
      }
   }

   void a(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         var1.d();

         while(true) {
            while(var1.r() != 4) {
               var1.j();
               if (var1.r() != 1) {
                  var1.a();
               } else if ("sparklineGroup".equals(var1.p()) && !var1.n()) {
                  this.b(var1);
               } else {
                  var1.a();
               }
            }

            var1.h();
            return;
         }
      }
   }

   void b(zcfw var1) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         SparklineGroup var2 = new SparklineGroup(this.b.getSparklineGroupCollection());
         this.b.getSparklineGroupCollection().a(var2);
         this.a(var1, var2);
         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else if ("colorSeries".equals(var1.p())) {
               var2.setSeriesColor(this.c(var1));
            } else if ("colorNegative".equals(var1.p())) {
               var2.setNegativePointsColor(this.c(var1));
            } else if ("colorAxis".equals(var1.p())) {
               var2.setHorizontalAxisColor(this.c(var1));
            } else if ("colorMarkers".equals(var1.p())) {
               var2.setMarkersColor(this.c(var1));
            } else if ("colorFirst".equals(var1.p())) {
               var2.setFirstPointColor(this.c(var1));
            } else if ("colorLast".equals(var1.p())) {
               var2.setLastPointColor(this.c(var1));
            } else if ("colorHigh".equals(var1.p())) {
               var2.setHighPointColor(this.c(var1));
            } else if ("colorLow".equals(var1.p())) {
               var2.setLowPointColor(this.c(var1));
            } else if ("f".equals(var1.p())) {
               var2.setHorizontalAxisDateRange(var1.i());
            } else if ("sparklines".equals(var1.p())) {
               this.b(var1, var2);
            } else {
               var1.a();
            }
         }

         var1.h();
      }
   }

   CellsColor c(zcfw var1) throws Exception {
      CellsColor var2 = this.a.a.createCellsColor();
      zakp var3 = new zakp(false);
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            if ("theme".equals(var1.p())) {
               int var4 = zase.C(var1.s());
               var3.a(4, var4);
            } else if ("tint".equals(var1.p())) {
               var3.a(zase.B(var1.s()));
            } else if ("rgb".equals(var1.p())) {
               Color var5 = zase.t(var1.s());
               var3.a(2, var5.toArgb());
            }
         }
      }

      var1.a();
      var2.a = var3;
      return var2;
   }

   void a(zcfw var1, SparklineGroup var2) throws Exception {
      var2.setType(0);
      var2.setPlotEmptyCellsType(1);
      if (var1.m()) {
         while(true) {
            if (!var1.l()) {
               var1.k();
               break;
            }

            if ("manualMax".equals(var1.p())) {
               var2.setVerticalAxisMaxValue(zase.B(var1.s()));
            } else if ("manualMin".equals(var1.p())) {
               var2.setVerticalAxisMinValue(zase.B(var1.s()));
            } else if ("type".equals(var1.p())) {
               var2.setType(zase.aK(var1.s()));
            } else if ("lineWeight".equals(var1.p())) {
               var2.setLineWeight(zase.B(var1.s()));
            } else if ("displayEmptyCellsAs".equals(var1.p())) {
               var2.setPlotEmptyCellsType(zase.az(var1.s()));
            } else if ("markers".equals(var1.p())) {
               var2.setShowMarkers(!"0".equals(var1.s()));
            } else if ("high".equals(var1.p())) {
               var2.setShowHighPoint(!"0".equals(var1.s()));
            } else if ("low".equals(var1.p())) {
               var2.setShowLowPoint(!"0".equals(var1.s()));
            } else if ("first".equals(var1.p())) {
               var2.setShowFirstPoint(!"0".equals(var1.s()));
            } else if ("last".equals(var1.p())) {
               var2.setShowLastPoint(!"0".equals(var1.s()));
            } else if ("negative".equals(var1.p())) {
               var2.setShowNegativePoints(!"0".equals(var1.s()));
            } else if ("displayXAxis".equals(var1.p())) {
               var2.setShowHorizontalAxis(!"0".equals(var1.s()));
            } else if ("displayHidden".equals(var1.p())) {
               var2.setDisplayHidden(!"0".equals(var1.s()));
            } else if ("minAxisType".equals(var1.p())) {
               var2.setVerticalAxisMinValueType(zase.aL(var1.s()));
            } else if ("maxAxisType".equals(var1.p())) {
               var2.setVerticalAxisMaxValueType(zase.aL(var1.s()));
            } else if ("rightToLeft".equals(var1.p())) {
               var2.setPlotRightToLeft(!"0".equals(var1.s()));
            }
         }
      }

   }

   void b(zcfw var1, SparklineGroup var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         SparklineCollection var3 = var2.getSparklineCollection();
         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else if ("sparkline".equals(var1.p())) {
               this.a(var1, var3);
            } else {
               var1.a();
            }
         }

         var1.h();
      }
   }

   void a(zcfw var1, SparklineCollection var2) throws Exception {
      if (var1.n()) {
         var1.a();
      } else {
         Sparkline var3 = new Sparkline(var2);
         var2.a(var3);
         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else if ("f".equals(var1.p())) {
               var3.setDataRange(var1.i());
            } else if ("sqref".equals(var1.p())) {
               byte var4 = 0;
               byte var5 = 0;
               int[] var6 = new int[]{var4};
               int[] var7 = new int[]{var5};
               CellsHelper.a(var1.i(), var6, var7);
               int var8 = var6[0];
               int var9 = var7[0];
               var3.a(var8);
               var3.b(var9);
            } else {
               var1.a();
            }
         }

         var1.h();
      }
   }
}
